// routes路由配置的类型限制
import type {RouteRecordRaw} from 'vue-router';

export const routes: RouteRecordRaw[] = [
    {
        path: '/',
        component: () => import('@/layout/index.vue'),
        redirect: '/home',
        children: [
            {
                path: 'home',
                name: 'Home',
                component: () => import('@/views/Home/index.vue')
            },
            {
                path: 'course',
                name: 'Course',
                component: () => import('@/views/Course/index.vue'),
                redirect:'/course/vip',
                children:[
                    {
                        path:'belowLine',
                        name:'BelowLine',
                        component:()=>import("@/views/Course/components/belowLine/belowLinePart.vue")
                    },
                    {
                        path:'liveCourse',
                        name:'LiveCourse',
                        component:()=>import("@/views/Course/components/liveCourse/liveCoursePart.vue")
                    },
                    {
                        path:'theme',
                        name:'theMe',
                        component:()=>import("@/views/Course/components/theme/theMePart.vue")
                    },
                    {
                        path:'video',
                        name:'Video',
                        component:()=>import("@/views/Course/components/video/videoPart.vue")
                    },
                    {
                        path:'vip',
                        name:'Vip',
                        component:()=>import("@/views/Course/components/vip/vipPart.vue")
                    }
                ]
            },
            {
                path: 'trainingroom',
                name: 'TrainingRoom',
                component: () => import('@/views/TrainingRoom/index.vue'),
                redirect:'trainingroom/training',
                children: [
                    {
                        path: 'training',
                        name: 'Training',
                        component: () => import('@/views/TrainingRoom/Training/index.vue')
                    },
                    {
                        path: 'collections',
                        name: 'Collections',
                        component: () => import('@/views/TrainingRoom/center/Collections/index.vue')
                    },
                    {
                        path: 'mediaCach',
                        name: 'MediaCach',
                        component: () => import('@/views/TrainingRoom/center/MediaCache/index.vue')
                    },
                    {
                        path: 'history',
                        name: 'History',
                        component: () => import('@/views/TrainingRoom/center/History/index.vue')
                    }
                ]
            },
            {
                path: 'communication',
                name: 'Communication',
                component: () => import('@/views/Communication/index.vue')
            },
            {
                path: 'my',
                name: 'My',
                component: () => import('@/views/My/index.vue')
            }
        ]

    },
    {
        path: '/404',
        name: '404',
        component: () => import('@/views/NotFound/index.vue')
    },
    // 任意路由
    {
        path: '/:pathMatch(.*)',
        name: 'Any',
        redirect: '/404'
    }

  ]
